-- SaveManager
-- 存档管理器
-- (未完工)

SaveManager = class()

function SaveManager:init()
    
end

-- 删除存档文件
function SaveManager.deleteMap(worldFile)
    local date = json.decode(readText(worldFile))
    local wi = WorldInfo()
    wi:readData(date[3])
    local h = os.getenv("HOME").."/Documents/" .. wi.name .. "-"
    local ending = ".txt"
    for i = 1,wi.length * wi.length // 256 do
        os.remove(h .. i .. ending)
    end
    saveText(worldFile,"")
    -- os.remove(os.getenv("HOME").."/Documents/" .. worldFile .. ending)
end
